package com.home.controller;

import com.home.common.RestResponse;
import com.home.model.User;
import com.home.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller

public class UserController {
    @Autowired
    private UserService userService;

    @ResponseBody
    @RequestMapping("getAllUserList")
    public RestResponse<List<User>> hiSpring(){
       List<User> list= userService.findall();

      return RestResponse.success(list);
    }
}
